import sun.applet.Main;

import java.util.Scanner;

/**
 * @Author  2022
 * @Date 2022/4/18  17:31
 * @Description:   Wei
 */

public class TextWei {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n = scanner.nextInt();
            int count = 0;
            while (n!=0){
                if ((n&1)!=0){
                    n =n>>1;
                    count ++;
                }else {
                    n >>=1;
                }
            }
            System.out.println(count);
        }
    }



/**
 * 1！+...+5！
 */
    public static void main1(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 4; i++) {
            sum += fac(i);
        }
        System.out.println(sum);
    }

    public static int fac(int n){
        int fang = n;
        while ((n-1)!=0){
            fang *= (n-1);
            n--;
        }
        return fang;
    }

    public static int fac1(int n) {
        int text = 1;
        for (int i = 1; i <= n; i++) {
            text *= i;
        }
        return text;
    }
}